---
layout: single
elementName: audio
---

<section id="audio" class="element">
  <header class="element-header">
    <nav class="element-links">
        <span>
          Type: <strong>block</strong>
        </span>
      <span>
        Self-closing:
        <strong>
            No
        </strong>
      </span>
      <a class="element-links-direct" href="{{site.url}}/element/audio/" data-element-name="audio" data-tooltip="Single page for this element">Permalink</a>
      <a class="element-share" data-tooltip="Share on Twitter or Facebook" data-element-name="audio">Share</a>
        <a target="_blank" href="https://caniuse.com/#feat=audio" data-tooltip="See on Can I use…" rel="external">Can I use</a>
      <a target="_blank" href="https://developer.mozilla.org/en/docs/Web/HTML/Element/audio" data-tooltip="See on Mozilla Developer Network" rel="external">MDN</a>
    </nav>
    <h2 class="element-name">
      <a href="#audio">
        <span>#</span>
        audio
      </a>
    </h2>
    <div class="element-description">
      <p>Allows to embed an audio clip into a web page.</p>

    </div>
  </header>

      <div id="audio-example-0" class="example">
        <p class="example-label">
          <strong>Example:</strong>
          <a class="example-clipboard" data-tooltip="Click to copy code" data-clipboard-target="#audio-example-0-code">Copy</a>
        </p>
        <article class="example-preview">
            <div class="example-output"><audio src="/assets/Hal.mp3" controls></audio></div>
          <div id="audio-example-0-code" class="example-code">{% highlight html %}<audio src="/assets/Hal.mp3" controls></audio>{% endhighlight %}</div>
        </article>
      </div>

    <article id="audio-src" class="attribute attribute--required">
      <header class="attribute-header">
        <h3 class="attribute-name">
          <code class="tag" data-tooltip="Click to copy" data-clipboard-text="src">
            src
          </code>
        </h3>
        <div class="attribute-description">
          <p>Defines the source of the audio file.</p>

            <strong class="attribute-is-required">Required.</strong>
        </div>
      </header>

      <div class="attribute-values">
          <article id="audio-src-assetshalmp3" class="value">
            <header class="value-header">
                <h4 class="value-name">
                  <code class="tag" data-tooltip="Click to copy src=&quot;/assets/Hal.mp3&quot;" data-clipboard-text="src=&quot;/assets/Hal.mp3&quot;">
                      "/assets/Hal.mp3"
                  </code>
                </h4>
              <div class="value-description">
                <p>You can use a <strong>relative</strong> path.</p>

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><audio  src="/assets/Hal.mp3" controls></audio></div>
            </aside>
          </article>
      </div>
    </article>
    <article id="audio-volume" class="attribute">
      <header class="attribute-header">
        <h3 class="attribute-name">
          <code class="tag" data-tooltip="Click to copy" data-clipboard-text="volume">
            volume
          </code>
        </h3>
        <div class="attribute-description">
          <p>Set the volume. Between <code>0.0</code> (silent) and <code>1.0</code> (loudest).</p>

        </div>
      </header>

      <div class="attribute-values">
          <article id="audio-volume-00" class="value">
            <header class="value-header">
                <h4 class="value-name">
                  <code class="tag" data-tooltip="Click to copy volume=&quot;0.0&quot;" data-clipboard-text="volume=&quot;0.0&quot;">
                      "0.0"
                  </code>
                </h4>
              <div class="value-description">
                <p>The track is <strong>silent</strong>.</p>

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><audio  src="/assets/Hal.mp3" controls volume="0.0"></audio></div>
            </aside>
          </article>
          <article id="audio-volume-10" class="value">
            <header class="value-header">
                <h4 class="value-name">
                  <code class="tag" data-tooltip="Click to copy volume=&quot;1.0&quot;" data-clipboard-text="volume=&quot;1.0&quot;">
                      "1.0"
                  </code>
                </h4>
              <div class="value-description">
                <p>The track is set to the <strong>loudest</strong>.</p>

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><audio  src="/assets/Hal.mp3" controls volume="1.0"></audio></div>
            </aside>
          </article>
      </div>
    </article>
    <article id="audio-autoplay" class="attribute attribute--novalue">
      <header class="attribute-header">
        <h3 class="attribute-name">
          <code class="tag" data-tooltip="Click to copy" data-clipboard-text="autoplay">
            autoplay
          </code>
        </h3>
        <div class="attribute-description">
          <p>The track will automatically start on load.</p>

            <strong class="attribute-is-novalue">No value required.</strong>
        </div>
      </header>

      <div class="attribute-values">
          <article id="audio-autoplay-undefined" class="value">
            <header class="value-header">
              <div class="value-description">

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><audio  src="/assets/Hal.mp3" controls volume="1.0"></audio></div>
            </aside>
          </article>
      </div>
    </article>
    <article id="audio-controls" class="attribute attribute--novalue">
      <header class="attribute-header">
        <h3 class="attribute-name">
          <code class="tag" data-tooltip="Click to copy" data-clipboard-text="controls">
            controls
          </code>
        </h3>
        <div class="attribute-description">
          <p>Show the browser&#39;s built-in audio controls.</p>

            <strong class="attribute-is-novalue">No value required.</strong>
        </div>
      </header>

      <div class="attribute-values">
          <article id="audio-controls-undefined" class="value">
            <header class="value-header">
              <div class="value-description">

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><audio  src="/assets/Hal.mp3" controls volume="1.0"></audio></div>
            </aside>
          </article>
      </div>
    </article>
    <article id="audio-loop" class="attribute attribute--novalue">
      <header class="attribute-header">
        <h3 class="attribute-name">
          <code class="tag" data-tooltip="Click to copy" data-clipboard-text="loop">
            loop
          </code>
        </h3>
        <div class="attribute-description">
          <p>The track will loop when reaching the end.</p>

            <strong class="attribute-is-novalue">No value required.</strong>
        </div>
      </header>

      <div class="attribute-values">
          <article id="audio-loop-undefined" class="value">
            <header class="value-header">
              <div class="value-description">

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><audio  src="/assets/Hal.mp3" controls volume="1.0" loop></audio></div>
            </aside>
          </article>
      </div>
    </article>
    <article id="audio-muted" class="attribute attribute--novalue">
      <header class="attribute-header">
        <h3 class="attribute-name">
          <code class="tag" data-tooltip="Click to copy" data-clipboard-text="muted">
            muted
          </code>
        </h3>
        <div class="attribute-description">
          <p>The track will be muted by default.</p>

            <strong class="attribute-is-novalue">No value required.</strong>
        </div>
      </header>

      <div class="attribute-values">
          <article id="audio-muted-undefined" class="value">
            <header class="value-header">
              <div class="value-description">

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><audio  src="/assets/Hal.mp3" controls volume="1.0" loop muted></audio></div>
            </aside>
          </article>
      </div>
    </article>
    <article id="audio-preload" class="attribute attribute--novalue">
      <header class="attribute-header">
        <h3 class="attribute-name">
          <code class="tag" data-tooltip="Click to copy" data-clipboard-text="preload">
            preload
          </code>
        </h3>
        <div class="attribute-description">
          <p>The track will be preloaded when the page loads.</p>

            <strong class="attribute-is-novalue">No value required.</strong>
        </div>
      </header>

      <div class="attribute-values">
          <article id="audio-preload-undefined" class="value">
            <header class="value-header">
              <div class="value-description">

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><audio  src="/assets/Hal.mp3" controls volume="1.0" loop muted></audio></div>
            </aside>
          </article>
      </div>
    </article>
</section>
